#include <iostream>


#include <stdio.h>



std::string data = "12345654321";

int main() {

    int len = data.length();

    char start = data[0];
    char end = data[len -1];

    for (int i = 0; i < len / 2; i++){
        if(start == end)
        {
            start = data[i];
            end = data[len - i -1];
        }
    }


    return 0;
}